﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Stack.Entities;
using Core.AbstractEntities;

namespace WCFServiceEmulatorHP48
{
    // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in Web.config and in the associated .svc file.
    public class ServiceEmulatorHP48 : IServiceEmulatorHP48
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

          private HpPile hpPile;

        public ServiceEmulatorHP48()
        {
            this.hpPile = new HpPile(); 
        }

        
        public void AddElement(HpElement item)
        {
            this.hpPile.AddElement(item);
        }


        #region IServiceEmulatorHP48 Members


        public HpPile GetPile()
        {
            return this.hpPile;
        }

        #endregion

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }
    }
}
